libxl: Do not trust backend for nic in list
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 4 May 2016 15:23:57 +0000 (16:23 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 2 Jun 2016 14:53:29 +0000 (15:53 +0100)
commitf7653d0d151732dd6dd8fcf84d94179fa8b6d4a5
treef7157f8ed4297662edf6f2fa95176071f994b0a5
parent6fd0b1574e9dd6ec38cdf38882d9d56fa7e47946
libxl: Do not trust backend for nic in list

libxl_device_nic_list should use the /libxl path to search for
devices, and for obtaining the device information.

The "type" parameter was always "vif".  Abolish it.  (In any case,
paths in /libxl/device are named after the frontend type which is
constant, not the backend type which might in future vary.)

Abolish a redundant store to pnic->backend_domid.  Before this commit,
that store was not needed because libxl_device_nic_init (called by
libxl__device_nic_from_xenstore) would zero it.  Now it overwrites the
correct backend domid with zero; so remove it.

This is part of XSA-178.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.c